Enumerating permutations sortable by k passes through a pop-stack
نویسندگان
چکیده
In an exercise in the first volume of his famous series of books, Knuth considered sorting permutations by passing them through a stack. Many variations of this exercise have since been considered, including allowing multiple passes through the stack and using different data structures. We are concerned with a variation using pop-stacks that was introduced byAvis andNewborn in 1981. Let Pk(x) be the generating function for the permutations sortable by k passes through a pop-stack. The generating function P2(x) was recently given by Pudwell and Smith (the case k = 1 being trivial). We show that Pk(x) is rational for any k. Moreover, we give an algorithm to derive Pk(x), and using it we determine the generating functions Pk(x) for k ≤ 6.
منابع مشابه
A Stack and a Pop Stack in Series
We study sorting machines consisting of a stack and a pop stack in series, with or without a queue between them. While there are, a priori, four such machines, only two are essentially different: a pop stack followed directly by a stack, and a pop stack followed by a queue and then by a stack. In the former case, we obtain complete answers for the basis and enumeration of the sortable permutati...
متن کاملA stack and pop stack in series
We study sorting machines consisting of a stack and a pop stack in series, with or without a queue between them. While there are, a priori, four such machines, only two are essentially different: a pop stack followed directly by a stack, and a pop stack followed by a queue and then by a stack. In the former case, we obtain complete answers for the basis and enumeration of the sortable permutati...
متن کاملSorted and or sortable permutations
In his Ph D thesis Julian West studied in depth a map that acts on permutations of the symmetric group Sn by partially sorting them through a stack The main motivation of this paper is to characterize and count the permutations of Sn which we call sorted permutations This is equivalent to counting preorders of increasing binary trees We rst nd a local characterization of sorted permutations The...
متن کامل2-stack Sortable Permutations with a given Number of Runs
Using earlier results we prove a formula for the number W(n,k) of 2stack sortable permutations of length n with k runs, or in other words, k − 1 descents. This formula will yield the suprising fact that there are as many 2-stack sortable permutations with k−1 descents as with k−1 ascents. We also prove that W(n,k) is unimodal in k, for any fixed n.
متن کاملOn the Stack Sortable and Pushpopable Permutations
This work proposes an O(log n) time parallel algorithm for testing whether a permutation is stack sortable or not by O(n) processors under the PRAM EREW computational model. Additionally, the number of permutations which are both stack sortable and pushpopable is also discussed, and an equality is finally obtained, which combines n!, 2, Cn, and Un together where Cn is the Catalan number and Un ...
متن کامل